package com.k.demo.mapper;

import java.awt.Point;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.k.demo.entity.PointDetail;

@Mapper
public interface PointDetailMapper {
	
	@Select("select * from point_detail where is_delete=1")
	List<PointDetail> getAll();
	
	int insertPointDetail(PointDetail pointDetail);
	
	List<PointDetail> selectAll(int user_id);
	
	//动态查找积分
	List<PointDetail> selectByPonDetail(PointDetail pointDetail);
	//找当天使用的积分总和
	@Select("select nvl(sum(point_change_amount),0) from point_detail where trunc(point_change_time)=to_date(#{date},'yyyy-mm-dd') and point_change_id=52 and is_delete =1")
	Double getTotalPointByDate(String date);
	
}
